package net.sf.rose.business.bean.database;

import java.io.Serializable;

import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Root;

/**
 * @author fengjian
 * @since 2014-6-12
 */
@Root(name = "link")
public class LinkMetaBean implements Serializable {

	private static final long serialVersionUID = 1L;

	/** 目标表名称 */
	@Attribute
	private String table = null;

	/** 目标字段名称 */
	@Attribute
	private String field = null;

	/** 连接类型 */
	@Attribute(required = false)
	private int type = 1;
	public static int one_to_one = 1;
	public static int one_to_many = 2;
	public static int many_to_one = 3;

	private TableMetaBean sourceTable = null;
	private FieldMetaBean sourceField = null;
	private TableMetaBean targetTable = null;
	private FieldMetaBean targetField = null;

	public String getTable() {
		return table;
	}

	public void setTable(String table) {
		this.table = table;
	}

	public String getField() {
		return field;
	}

	public void setField(String field) {
		this.field = field;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public TableMetaBean getSourceTable() {
		return sourceTable;
	}

	public void setSourceTable(TableMetaBean sourceTable) {
		this.sourceTable = sourceTable;
	}

	public FieldMetaBean getSourceField() {
		return sourceField;
	}

	public void setSourceField(FieldMetaBean sourceField) {
		this.sourceField = sourceField;
	}

	public TableMetaBean getTargetTable() {
		return targetTable;
	}

	public void setTargetTable(TableMetaBean targetTable) {
		this.targetTable = targetTable;
	}

	public FieldMetaBean getTargetField() {
		return targetField;
	}

	public void setTargetField(FieldMetaBean targetField) {
		this.targetField = targetField;
	}

}
